package demo

import (
	"tosServer/internal/model"
	"tosServer/internal/pkg/common"
	"tosServer/internal/pkg/db"

	"github.com/gin-gonic/gin"
)

func (d *Demo) Test(c *gin.Context) {

	davUser := &model.DavUser{}
	db.Db().Find(davUser)

	d.Api.Success(c, &common.R{
		Data: davUser,
	})
}

func (d *Demo) Test1(c *gin.Context) {

	davUser := &model.DavUser{}
	db.Db().Where(model.DavUser{
		Username: "123",
	}).Preload("DavUserRole").First(davUser)

	d.Api.Success(c, &common.R{
		Data: davUser,
	})
}
